home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / os2 / os2cl015.zip / pmhelp.cpp < prev    next >
C/C++ Source or Header  |  1995-11-24  |  2KB  |  75 lines

  1. /* 
  2.  
  3.  
  4.     pmhelp.cpp (emx+gcc) 
  5.  
  6.     1995 Giovanni Iachello
  7.     This is freeware software. You can use or modify it as you wish,
  8.     provided that the part of code that I wrote remains freeware.
  9.     Freeware means that the source code must be available on request 
  10.     to anyone.
  11.     You must also include this notice in all files derived from this
  12.     file.
  13.  
  14.  
  15. */
  16. #include <stdio.h>
  17. #include <stdlib.h>
  18. #include <string.h>
  19.  
  20. #include "pmwin.h"
  21. #include "pmhelp.h"
  22. #include "pmstdres.h"
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25.  
  26. PMHelpWin::PMHelpWin(PSZ title,PSZ library,USHORT id,HAB hab) : PMWin(hab)
  27. {
  28.     hiInit.cb = sizeof (HELPINIT);
  29.     hiInit.ulReturnCode = 0;
  30.     hiInit.pszTutorialName = NULL;
  31.     hiInit.phtHelpTable = ( PHELPTABLE ) MAKEULONG (id, 0xffff);
  32.     hiInit.hmodHelpTableModule = NULLHANDLE;
  33.     hiInit.hmodAccelActionBarModule = NULLHANDLE;
  34.     hiInit.idAccelTable = 0;
  35.     hiInit.idActionBar = 0;
  36.     hiInit.pszHelpWindowTitle = title;
  37.     hiInit.fShowPanelId = CMIC_HIDE_PANEL_ID;
  38.     hiInit.pszHelpLibraryName = library;
  39. }
  40.  
  41. PMHelpWin::PMHelpWin(PSZ title,PSZ library,PHELPTABLE pht,HAB hab) : PMWin(hab)
  42. {
  43.     hiInit.cb = sizeof (HELPINIT);
  44.     hiInit.ulReturnCode = 0;
  45.     hiInit.pszTutorialName = NULL;
  46.     hiInit.phtHelpTable = pht;
  47.     hiInit.hmodHelpTableModule = NULLHANDLE;
  48.     hiInit.hmodAccelActionBarModule = NULLHANDLE;
  49.     hiInit.idAccelTable = 0;
  50.     hiInit.idActionBar = 0;
  51.     hiInit.pszHelpWindowTitle = title;
  52.     hiInit.fShowPanelId = CMIC_HIDE_PANEL_ID;
  53.     hiInit.pszHelpLibraryName = library;
  54. }
  55.  
  56. BOOL PMHelpWin::createWin()
  57. {
  58.     hwnd= WinCreateHelpInstance( ab, &hiInit );
  59.     assert(hwnd);
  60.     return TRUE;
  61. }
  62.  
  63. BOOL PMHelpWin::destroyWin()
  64. {
  65.     return WinDestroyHelpInstance(hwnd);
  66. }
  67.  
  68. PMHelpWin::~PMHelpWin()
  69. {
  70.     destroyWin();
  71. }
  72.  
  73.  
  74.  
  75.